//==========================================================================================
//BoundingE.h
//Determines best fitting ellipse and bounding box for contours (used in correspondence)
//==========================================================================================


#ifndef BOUNDINGE_H
#define BOUNDINGE_H


class Vec2d;
//class for bounding ellipses
class BoundingE {

	public:
		//center of best fit ellipse
		Vec2d center;

		//orientation of major and minor axes
		double theta;
		//size of the major and minor axes and 
		double xAxis,yAxis;

		void findEllipse(const std::vector<Vec2d> poly);
		void findEllipseConv(const std::vector<Vec2d> poly);
		void findHull(const std::vector<Vec2d> poly,std::vector<Vec2d> &convHull);

	private:
		//finds the hull of a sorted polygon vertex list
		void findHullSrt(const std::vector<Vec2d> poly,std::vector<Vec2d> &convHull);
};

#endif

